1. Field of the Invention
This invention relates to computer systems, and more specifically to techniques for memory virtualization.
2. Description of the Relevant Art
Modern computer systems provide a feature known as “virtual memory”, or “virtual memory addressing”, a technique of memory address translation between addresses used in a software application and physical memory addresses. These translation mechanisms allow the addresses used by the application to be independent of the addresses of the underlying physical memory. Thus, an application may access addresses that translate to locations in a processor's local or main memory (e.g., the CPU's caches, or local dynamic RAM) or to locations in disk storage (which is slower, but may be much larger) without having to know which it is accessing.
When used in combination with a technique of “swapping” or “paging”, virtual memory addressing may provide an application with the illusion that the memory address space is contiguous, even if the physical memory allocated to the application is not contiguous, and/or possibly that it is larger than the machine's physical memory. Typically, the application cannot address physical memory directly but only after going through the translation process. This translation process is generally transparent to the application programmer and is implemented in specialized hardware, memory management software, or a combination of the two.
There are several different techniques for transparent translation between memory addresses used by an application and physical addresses. These include page-based translation and segment-based translation. In page-based translation, the high order bits of the binary representation of a logical (virtual) address are used as an index or key to an address translation table, called a page table, while the low order bits are used directly as the low order bits of the physical address. Thus, a “page” of memory is a range of consecutive virtual addresses having the same high order bits and corresponding to a particular block of physical memory. In segmentation, physical memory is divided into blocks of different sizes, called segments. Software programs and their associated data structures are stored in one or more of these segments. This technique generally represents a higher organizational level than pages, and tends to reflect the type of information that is to be stored in any memory segment. For example, a program's instructions may be stored in one segment and its data structures may be stored in another segment.
Currently, computer architectures are configured to employ a single, static address translation technique, which may be selectable during initialization or at system reset. This address translation technique is usually implemented in a combination of processor hardware and memory management software that provides the functionality described above. The single translation technique employed may have a significant impact on the overall performance of the computer system. For example, a particular technique may result in very poor performance under certain workloads, while, under the same workload, a different technique may result in higher performance. Similarly, a particular technique may result in very high performance for certain applications and poor performance for others.